package com.cnzha.mr.kvInpuFormat;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 * @Author: zhaoxin
 * @email: zdkk@foxmail.com
 * @Date: 2020/4/4 14:37
 */
public class KVMapper extends Mapper<Text,Text,Text, LongWritable> {

    LongWritable longWritable = new LongWritable(1);

    @Override
    protected void map(Text key, Text value, Context context) throws IOException, InterruptedException {
//        String firstWord = key.toString().split(" ")[1];

        context.write(key,longWritable);

    }
}
